const axios = require("axios");

// 登录时获取openid
exports.getOpenid = async function (appid, secret, js_code) {
  const url = `https://api.weixin.qq.com/sns/jscode2session?appid=${appid}&secret=${secret}&js_code=${js_code}&grant_type=authorization_code`;
  const res = await axios.get(url);
  return res.data;
};
